#include <iostream>
#include <cstring>
#include "mbuild.h"

 int main(int argc,char* argv[]) {
	 if (argc != 2) {
		 cout<<"Usage:\n";
		 cout<<"dxave dxfile1.dx \n";
		 return 0;
	 }
	 char* filename;
	 filename=argv[1];
	 char* b=strrchr(filename,'.');
	 char basename[256];
         strncpy(basename,filename,b-filename);
         basename[b-filename]='\0';
         strcat(basename,".ave");
	 DxFile f;
	 f.read(filename);
	 f.ave(basename);
 return 0;
 }
